// ignore_for_file: must_be_immutable

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:zrjz/comm/constants/color_constants.dart';
import 'package:zrjz/comm/constants/constants.dart';
import 'package:zrjz/comm/utils/ex_widget.dart';
import 'package:zrjz/comm/widget/common_widget.dart';
import 'package:zrjz/comm/widget/my_load_image.dart';
import 'package:zrjz/comm/widget/my_text_view.dart';
import 'package:zrjz/generated/assets.dart';

/// 登录页面举报电话弹窗
class ReportPhoneNumDialog extends StatelessWidget {
  void Function(String phone) action;

  ReportPhoneNumDialog({
    Key? key,
    required this.action,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(top: 12, bottom: 15),
      decoration:  BoxDecoration(
        color:  DarkThemeUtil.multiColors(ColorConstants.white,darkColor: ColorConstants.darkBlackItem),
        borderRadius: const BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          //标题
          Row(
            children: [
              MyTextView(
                "举报监督电话".tr,
                isFontBold: true,
                fontSize: 17,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ).expanded(),

              //删除按钮
              const MyAssetImage(
                Assets.imagesDialogDeleteIcon,
                width: 22,
                height: 22,
              ).onTap(onCancel),

              CommonWidget.rowWidth(width: 12),
            ],
          ),

          Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              MyTextView(
                "违法不良信息举报电话".tr,
                isFontMedium: true,
                fontSize: 15,
                marginLeft: 15,
                marginTop: 25,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
              MyTextView(
                "400-885-9898",
                isFontRegular: true,
                fontSize: 15,
                marginTop: 5,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
            ],
          ).onTap(() {
            action.call("400-885-9898");
          }),

          Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              MyTextView(
                "关爱未成年举报热线".tr,
                isFontRegular: true,
                fontSize: 15,
                marginTop: 25,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
              MyTextView(
                "400-885-9898-7",
                isFontRegular: true,
                marginTop: 5,
                fontSize: 15,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
            ],
          ).onTap(() {
            action.call("400-885-9898-7");
          }),

          Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              MyTextView(
                "武汉市人力资源与社会保障局监督电话".tr,
                isFontRegular: true,
                marginTop: 25,
                fontSize: 15,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
              MyTextView(
                "027-12333",
                isFontRegular: true,
                fontSize: 15,
                marginTop: 5,
                marginLeft: 15,
                textColor: DarkThemeUtil.multiColors(ColorConstants.black,darkColor: ColorConstants.white),
              ),
            ],
          ).onTap(() {
            action.call("027-12333");
          }),

          const SizedBox(height: 20),
        ],
      ),
    );
  }

  //取消弹框
  void onCancel() async {
    SmartDialog.dismiss();
  }
}
